package com.lixinyu.springboot.Service.Serviceimpl;

import com.lixinyu.springboot.Service.UserService;
import com.lixinyu.springboot.mapper.UserMapper;
import com.lixinyu.springboot.model.User;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserserviceImpl implements UserService {

    @Autowired
    public UserMapper userMapper;

    @Override
    public int login(User user) {
        User user1 = userMapper.login(user);
        if (user1 == null) {
            return 0;
        } else {
            return 200;
        }
    }

    @Override
    public void Add(User user) {
        userMapper.Add(user);
    }

    @Override
    public void Add2(String name, String password) {
        userMapper.Add2(name, password);
    }

    @Override
    public List<User> Userlist() {
        return userMapper.UserList();
    }
}
